/**
 * Created by Administrator on 2017\9\25 0025.
 */
import React from 'react';
import {Link} from 'react-router-dom';
import { Row,Col,Input,Form,Button} from 'antd';
import template from './../../commonui/template';
import InputList from './InputList'
import MenuList from './MenuList';
const FormItem = Form.Item;
const { TextArea } = Input;

class BasicPkg extends React.Component{
    constructor(props){
        super(props);
        this.handleSubmit=this.handleSubmit.bind(this);
    }
    handleSubmit(e){
        e.preventDefault();
        this.props.form.validateFields((err,values)=>{
            if(!err){
                console.log('Received values of form:',values);
            }
        })
    }
    render(){
        const {getFieldDecorator,getFieldProps} = this.props.form;
        return(
            <div>
                <Row>
                    <Col span={6}>
                        <MenuList/>
                    </Col>
                    <Col span={18}>
                         <h4>Basic Package Setting</h4>
                        <Form onSubmit={this.handleSubmit}>
                    <Row>
                        <Col span={12}>
                            <FormItem label="Package Name">{getFieldDecorator('name',{
                                rules:[{required:true,message:""}
                                ]
                            })(<Input />)
                            }</FormItem>
                        </Col>
                         <Col span={12}>
                            <FormItem label="Package Price">{getFieldDecorator('price',{
                                rules:[{required:true,message:""}
                                ]
                            })(<Input />)
                            }</FormItem>
                        </Col>
                    </Row>
                    <Row>
                        <Col span={8}>
                            <Row>
                                <InputList default="Enter Dept"{...getFieldProps('cs1')}/>
                            </Row>
                        </Col>
                        <Col span={8}>
                              <InputList default="Add Field" {...getFieldProps('cs2')}/>
                        </Col>
                        <Col span={8}>
                              <h3>Details</h3>
                                <TextArea rows={10} name="details" placeholder="cs" {...getFieldProps('note')}/>
                        </Col>
                    </Row>
                    <Row>
                        <Col>
                            <Button htmlType="submit">Save</Button>
                        </Col>
                    </Row>
                </Form>
                    </Col>
                </Row>
            </div>
        )
    }
}
const BasicPkgs = Form.create()(BasicPkg)
export default template({
    id: 'BasicPkg',
    component: BasicPkgs
});